package ca.tatham.triplipse.perspectives;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import ca.tatham.triplipse.views.table.TableRdfDocumentView;
import ca.tatham.triplipse.views.tree.TreeRdfDocumentView;
import ca.tatham.triplipse.wizards.NewRdfXmlWizard;
import ca.tatham.triplipse.wizards.NewTurtleWizard;

public class RdfPerspectiveFactory implements IPerspectiveFactory {

	public static final String PERSPECTIVE_ID = "ca.tatham.triplipse.perspective";

	public void createInitialLayout(IPageLayout layout) {
		layout.addNewWizardShortcut(NewRdfXmlWizard.WIZARD_ID);
		layout.addNewWizardShortcut(NewTurtleWizard.WIZARD_ID);
		
		layout.addShowViewShortcut(TreeRdfDocumentView.VIEW_ID);
		layout.addShowViewShortcut(TableRdfDocumentView.VIEW_ID);

		String editorArea = layout.getEditorArea();

		// Top left.
		IFolderLayout topLeft = layout.createFolder(
				"topLeft", IPageLayout.LEFT, (float) 0.26, editorArea);//$NON-NLS-1$
		topLeft.addView(IPageLayout.ID_RES_NAV);

		// Bottom left.
		IFolderLayout bottomLeft = layout.createFolder(
				"bottomLeft", IPageLayout.BOTTOM, (float) 0.50,//$NON-NLS-1$
				"topLeft");//$NON-NLS-1$
		bottomLeft.addView(TableRdfDocumentView.VIEW_ID);

		// Bottom right.
		IFolderLayout bottomRight = layout.createFolder(
				"bottomRight", IPageLayout.BOTTOM, (float) 0.66,//$NON-NLS-1$
				editorArea);
		bottomRight.addView(TreeRdfDocumentView.VIEW_ID);

	}

}
